/***
 *  跨组件传参
 *  一级传给三级
 *  层层传递
 *
 */

import { Component } from 'react'

export default class GrandFather extends Component {
  state = {
    money: 100
  }
  render() {
    return (
      <div>
        爷爷有:{this.state.money}
        <Father money={this.state.money}></Father>
      </div>
    )
  }
}
class Father extends Component {
  render() {
    return (
      <div>
        爸爸
        <Son money={this.props.money}></Son>
      </div>
    )
  }
}
class Son extends Component {
  render() {
    return <div>孙子获取到爷爷给的钱:{this.props.money}</div>
  }
}
